Patterns: Allow for filtering of block patterns by source#4697
Patterns: Allow for filtering of block patterns by source#4697aaronrobertshaw wants to merge 6 commits into
Conversation
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
| 'core/' . $core_block_pattern, | ||
| require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php' | ||
| ); | ||
| $pattern = require ABSPATH . WPINC . '/block-patterns/' . $core_block_pattern . '.php'; |
There was a problem hiding this comment.
I think the path was only changed in the gutenberg plugin because the plugin is in a different directory.
No need to bring this change over to core.
There was a problem hiding this comment.
Thank you for explaining that 👍
I did a brief check elsewhere in core and saw similar approaches in defining required paths, so mistakenly brought that over.
| require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php' | ||
| ); | ||
| $pattern = require ABSPATH . WPINC . '/block-patterns/' . $core_block_pattern . '.php'; | ||
| $pattern['source'] = 'core'; // Added in 6.3.0. |
There was a problem hiding this comment.
The 'Added in 6.3.0' comments are useful in the Gutenberg plugin, but not so useful here, so I think they can be removed.
ramonjd
left a comment
There was a problem hiding this comment.
I merged this into
Which has the latest Gutenberg packages
Functionality, as described in WordPress/gutenberg#51672 works well.
✅ Explore the library categories and ensure that only template parts, theme patterns, and reusable blocks are shown.
This is a backport PR for WordPress 6.3 that includes the following PHP Gutenberg changes:
Trac ticket: https://core.trac.wordpress.org/ticket/58622
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.